"use strict";
// 1.字符串类型 ''、 ""、``
var aName = "貂蝉";
// 2.数值类型
var dAge = 18;
dAge = 18.13;
dAge = -17;
// 3.布尔值类型  true /false
var isSingleDog = true;
isSingleDog = false;
// 4.undefined 和null
var undef = undefined;
var nul = null;
// 5.数组
var arrJs = [1, "a", true, [], {}]; //arrJs
var arrHero = ["安吉拉", "大桥", "貂蝉"]; //ts
var arrHeroAge = [18, 27, 30];
// 泛型
var arrHeroAge2 = ["安吉拉", "大桥", "貂蝉"];
// 7.元组(tuple):就是一个已知元素数量和每个元素类型的数组，内部的元素类型不必相同
var tup1 = ["讨厌，死鬼", 18, true];
tup1 = ["死鬼", 19, false];
// 访问元祖中元素和长度
console.log(tup1.length);
console.log(tup1[0]);
// 8.枚举(enum):用一组标识 来 代表数值，方便程序员调用理解
// 8.1创建性别枚举
var Gender;
(function (Gender) {
    Gender[Gender["Boy"] = 1] = "Boy";
    Gender[Gender["Girl"] = 2] = "Girl";
    Gender[Gender["Unknown"] = 3] = "Unknown";
})(Gender || (Gender = {}));
console.log(Gender.Boy);
console.log(Gender.Unknown);
var Gender2;
(function (Gender2) {
    Gender2[Gender2["Boy"] = 0] = "Boy";
    Gender2[Gender2["Girl"] = 1] = "Girl";
    Gender2[Gender2["Unknown"] = 2] = "Unknown";
})(Gender2 || (Gender2 = {})); //不给值默认从下标开始
// 8.2使用性别枚举
var usrSex = Gender.Boy;
if (usrSex === Gender.Boy) {
    console.log("相等");
}
else {
    console.log(usrSex);
}
// 1.函数返回值 类型
function sayHi() {
    return "hi~~ old driver";
}
var res1 = sayHi();
// 2.函数 形参 类型
function jumpSan(cityName) {
    console.log("\u5144\u5F1F\uFF0C\u8DF3\u54EA\u91CC?" + cityName);
}
jumpSan("p城");
// 2.1ts中实参必须和形参的类型一致
// 2.2ts中实参和形参的数量必须一致
// 可选参数
// 默认值
function buyGun(num) {
    if (num === void 0) { num = 1; }
}
// 剩余参数
function add(x, y) {
    var restOfNum = [];
    for (var _i = 2; _i < arguments.length; _i++) {
        restOfNum[_i - 2] = arguments[_i];
    }
}
